home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / compress / tar321__.zip / SOURCES.ZIP / ASPIENT.ASM < prev    next >
Assembly Source File  |  1994-12-31  |  934b  |  53 lines

  1.         include    farnear.inc
  2.  
  3. _TEXT        segment    byte public 'CODE'
  4.         assume    cs:_TEXT
  5. mgrname        db    'SCSIMGR$',0
  6.  
  7.     program    _ASPI_entry    ; int ASPI_entry(void far (**)())
  8.         push    bp
  9.         mov    bp,sp
  10.         push    ds
  11.  
  12.         push    cs
  13.         pop    ds
  14.  
  15.         lea    dx,mgrname
  16.         mov    ax,3d00h
  17.         int    21h    ; open file
  18.         mov    cx,-1    ; does not affect flags
  19.         jc    short return
  20.  
  21.         push    ax    ; save the handle
  22.         xchg    ax,bx    ; mov bx,ax
  23.         mov    ax,4400h
  24.         int    21h    ; query device info
  25.         jc    short error
  26.         test    dl,dl    ; is it device or file?
  27.         jns    short error
  28.  
  29.         pop    bx    ; restore the handle
  30.                 push    bx    ; put it back again
  31.  
  32.         lds    dx,arglist
  33.         mov    cx,4
  34.         mov    ax,4402h
  35.         int    21h    ; read the pointer
  36.         jc    short error
  37.         xor    cx,cx    ; mark success
  38.         jmp    short close
  39. error:
  40.         mov    cx,-1    ; mark an error
  41. close:
  42.         pop    bx    ; BX := handle
  43.         mov    ah,3Eh
  44.         int    21h
  45. return:
  46.         xchg    ax,cx    ; mov ax,cx
  47.         pop    ds
  48.         pop    bp
  49.         ret
  50. _ASPI_entry    endp
  51. _TEXT        ends
  52.         end
  53.